﻿using PAP.Presentation.Web.UI.ViewModels.Account;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;

namespace PAP.Presentation.Web.UI.Controllers
{
    public partial class AccountController : Controller
    {
        [HttpPost]
        [AllowAnonymous]
        public virtual ActionResult LogOn(LoginViewModel viewModel)
        {
            if (this.ModelState.IsValid)
            {
                //if (Membership.ValidateUser(viewModel.Login, viewModel.Password))
                //{
                //    FormsAuthentication.SetAuthCookie(viewModel.Login, viewModel.RememberMe);
                 //    return RedirectToAction(MVC.Home.ActionNames.Index, MVC.Home.Name);
                //}
            }

            return View(viewModel);
        }

        [AllowAnonymous]
        public virtual ActionResult LogOff()
        {
            FormsAuthentication.SignOut();

            return new EmptyResult();
        }
    }
}
